//
//  SubjectSelectViewController.m
//  CNKICommunity
//
//  Created by wei on 17/3/3.
//  Copyright © 2017年 CNKI. All rights reserved.
//

#import "SubjectSelectViewController.h"
#import "CNKIScrollview.h"


@interface SubjectSelectViewController ()<CNKIScrollviewClickDelegate>

@property(nonatomic,strong)CNKIScrollview *HorizonScorllview;
@property(nonatomic,strong)CNKIScrollview *VerticalScorllview;
@property(nonatomic,strong)NSArray *ContentArr;
@end

@implementation SubjectSelectViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self setContent];
    [self setUpScorllView];
}
-(void)setContent
{
    NSArray *arr0 = @[@"数学",@"物理",@"化学",@"天文",@"地理",@"大气",@"海洋",@"地球物理",@"地质",@"生物",@"系统科学",@"生态",@"统计",@"力学"];
    NSArray *arr1 = @[@"机械工程",@"仪表仪器",@"材料",@"金属学及工艺",@"冶金工程",@"动力工程",@"电气工程",@"电子技术",@"信息通信",@"控制工程",@"计算机",@"建筑科学"];
    NSArray *arr2 = @[@"基础医学",@"临床医学",@"公共卫生与预防医学",@"中西医结合",@"药学",@"中药与方剂",@"特种医学",@"护理"];
    NSArray *arr3 = @[@"作物",@"果树",@"蔬菜",@"观赏园林与园艺",@"农业资源与环境",@"植物保护",@"畜牧",@"兽医",@"林学",@"水产"];
    NSArray *arr4 = @[@"哲学"];
    NSArray *arr5 = @[@"理论经济",@"数量经济",@"国民经济",@"区域经济",@"劳动经济",@"物流经济",@"城市经济",@"农业经济",@"工业经济",@"交通运输经济"];
    NSArray *arr6 = @[@"宗教",@"语言",@"文学",@"考古",@"历史",@"艺术",@"音乐",@"戏剧",@"美术",@"舞蹈",@"影视"];
    NSArray *arr7 = @[@"哲学"];
    NSArray *arr8 = @[@"理论经济",@"数量经济",@"国民经济",@"区域经济",@"劳动经济",@"物流经济",@"城市经济",@"农业经济",@"工业经济",@"交通运输经济"];
    NSArray *arr9 = @[@"宗教",@"语言",@"文学",@"考古",@"历史",@"艺术",@"音乐",@"戏剧",@"美术",@"舞蹈",@"影视"];
    
    _ContentArr = @[arr0,arr1,arr2,arr3,arr4,arr5,arr6,arr7,arr8,arr9];
}
-(void)setUpScorllView
{
    
    CNKIScrollview *CNScorllview = [[CNKIScrollview alloc]initWithFrame:CGRectMake(0, 64, SCREENWIDTH - 50, 43)];
    CNScorllview.CNKIScrollviewDelegate = self;
    CNScorllview.mode = CNKIScrollviewHorizon;
    CNScorllview.TitleFont = [UIFont systemFontOfSize:14];
    CNScorllview.SelectTitleColor = [UIColor blueColor];
    CNScorllview.DeSelectTitleColor = [UIColor blackColor];
    CNScorllview.WidthMode = CNKIScrollviewEqualWidth;
    CNScorllview.IndicateBackgroudColor = [UIColor redColor];
    CNScorllview.IndicateHeight = 3;
    CNScorllview.ButtonDisplayNum = 5;
    NSArray *MainArr = @[@"自然科学",@"工程",@"医学",@"农业",@"哲学",@"社会科学",@"人文",@"哲学",@"社会科学",@"人文"];
    CNScorllview.ButtonContent = MainArr;
    [self.view addSubview:CNScorllview];
    _HorizonScorllview = CNScorllview;
    
    
    
    CNKIScrollview *NormalScorllview = [[CNKIScrollview alloc]initWithFrame:CGRectMake(0, 64 + 43, 90, SCREENHEIGHT - 64 - 43)];
    NormalScorllview.CNKIScrollviewDelegate = self;
    NormalScorllview.mode = CNKIScrollviewVertical;
    NormalScorllview.TitleFont = [UIFont systemFontOfSize:14];
    NormalScorllview.SelectTitleColor = [UIColor blueColor];
    NormalScorllview.DeSelectTitleColor = [UIColor blackColor];
    NormalScorllview.IndicateBackgroudColor = [UIColor redColor];
    NormalScorllview.IndicateHeight = 3;
    NormalScorllview.ButtonContent = _ContentArr[0];
    [self.view addSubview:NormalScorllview];
    _VerticalScorllview = NormalScorllview;
    
    
    
    
}
-(void)clickBtnId:(NSInteger)BtnId BtnName:(NSString *)Name
{
    NSLog(@"点击的是%@",Name);
}

-(void)clickHorizonBtnId:(NSInteger)BtnId BtnHorizonName:(NSString *)Name
{
    _VerticalScorllview.ButtonContent = _ContentArr[BtnId];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
